/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Chat;

import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 *
 * @author danielsl & thorerikmidtb
 * Defines the interface that is used by the client and implemented by the server.
 * And as you can see, we have the Callback interface as an argument in these methods.
 * 
 */
interface Server extends Remote {
    /**
     * This is used by a client who wants to connect to the server.
     * @param c
     * @throws RemoteException
     */
    void connect(Callback c) throws RemoteException;

    /**
     * This is used by a client when they want to speak to everyone, or for typing in commands.
     * @param message
     * @param c
     * @throws RemoteException
     */
    void broadcast(String message, Callback c) throws RemoteException;

    /**
     * This is used by a client when they want to speak to someone in private.
     * @param message
     * @param whisperTo
     * @param c
     * @throws RemoteException
     */
    void whisper(String message, String whisperTo, Callback c) throws RemoteException;

    /**
     * This is used by a client when they want to disconnect/quit from the server.
     * @param c
     * @throws RemoteException
     */
    void quit(Callback c) throws RemoteException;
}
